import unittest


class Demo1:
    pass


class Demo2:
    pass


class testDemo(unittest.TestCase):

    def setUp(self):
        print('start')

    @classmethod
    def tearDownClass(cls):
        print('end')

    def test01(self):
        '''This is description for test01.'''
        d = Demo1()
        self.assertIsInstance(d, Demo1, 'This is test1.')
        # self.fail('fail test')    #强制标识用例为Fail
        # print(self.id())        #打印测试用例的编号
        print(self.shortDescription())  # 返回测试用例的描述, 也就是函数的docstring

    # @unittestdemo.skip('test')
    def test02(self):
        d = Demo2()
        self.assertIsInstance(d, Demo2, 'This is test02.')


if __name__ == '__main__':
    unittest.main()
